import { defineStore } from 'pinia'

export const useMenuStore = defineStore({
  id: 'menu',
  state: () => ({
    menuFoldStatus: true,
    isInFront: true // 用来判断当前是在前台还是后台
  }),
  actions: {
    // 切换菜单折叠状态
    toggleMenuFoldStatus() {
      this.menuFoldStatus = !this.menuFoldStatus
    },
    // 切换前台后台
    toggleIsInFront() {
      this.isInFront = !this.isInFront
    },
    setIsInFront(val: boolean) {
      this.isInFront = val
    }
  }
})
